package com.tunan.lsj.idgenerator;

import javax.sql.DataSource;

import org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer;

public class DaMengSequenceMaxValueIncrementer extends AbstractSequenceMaxValueIncrementer {

	private String schema;

	public String getSchema() {
		return schema;
	}

	public void setSchema(String schema) {
		this.schema = schema;
	}

	public DaMengSequenceMaxValueIncrementer() {
	}

	public DaMengSequenceMaxValueIncrementer(DataSource dataSource, String schema, String incrementerName) {
		super(dataSource, incrementerName.toUpperCase());
		this.schema = schema.toUpperCase();
	}

	@Override
	protected String getSequenceQuery() {
		return "SELECT " + getSchema() + "." + getIncrementerName() + ".NEXTVAL";
	}

}
